#include <cstdio>
#include <algorithm>
#include <cmath>
#include <stack>

using namespace std;

struct Point
{
    double x, y;
};

struct Vector
{
    double x, y;
    Point a, b;
    Vector( ) { }
    Vector( Point _a, Point _b )
        : a( _a ), b( _b ), x( _b.x - _a.x ), y( _b.y - _a.y ) { }
};

bool operator < ( const Point &a, const Point &b )
{
    if ( a.y < b.y )
        return true;
    if ( a.y > b.y )
        return false;
    return a.x < b.x;
}

double VCross( Vector a, Vector b )
{
    return a.x * b.y - a.y * b.x;
}

int n;
Point p[ 1000000 ];

void init( )
{
    int i;
    for ( i = 0; i < n; i++ )
        scanf("%lf%lf", &p[ i ].x, &p[ i ].y );
    sort( p, p + n );
}

void work( )
{
    stack<Vector> s;
    Vector v1, v2;
    double rope = 0;
    int i;
    s.push( Vector( p[ 0 ], p[ 1 ] ) );
    for ( i = 2; i < n; i++ )
    {
        v1 = s.top( );
        v2 = Vector( v1.b, p[ i ] );
        while ( VCross( v1, v2 ) < 0 )
        {
            s.pop( );
            if ( s.empty( ) )
            {
                v2 = Vector( p[ 0 ], p[ i ] );
                break;
            }
            v1 = s.top( );
            v2 = Vector( v1.b, p[ i ]);
        }
        s.push( v2 );
    }
    for ( i = n - 2; i >= 0; i-- )
    {
        v1 = s.top( );
        v2 = Vector( v1.b, p[ i ] );
        while ( VCross( v1, v2 ) < 0 )
        {
            s.pop( );
            if ( s.empty( ) )
            {
                v2 = Vector( p[ 0 ], p[ i ] );
                break;
            }
            v1 = s.top( );
            v2 = Vector( v1.b, p[ i ]);
        }
        s.push( v2 );
    }
    while ( !s.empty( ) )
    {
        v1 = s.top( );
        s.pop( );
        rope += sqrt( v1.x * v1.x + v1.y * v1.y );
    }
    printf("%.2lf\n", rope);
}

int main( )
{
    while ( scanf("%d", &n) && n )
    {
        if ( n == 1 )
        {
            puts("0.00");
            continue;
        }
        init( );
        if ( n == 2 )
        {
            printf("%.2lf\n", sqrt( ( p[ 0 ].x - p[ 1 ].x ) * ( p[ 0 ].x - p[ 1 ].x ) + 
                ( p[ 0 ].y - p[ 1 ].y ) * ( p[ 0 ].y - p[ 1 ].y ) ));
            continue;
        }
        work( );
    }
    return 0;
}
